from docxtpl import DocxTemplate
tpl = DocxTemplate('./file.docx')
#这些字段从csv中获取
context = {
   "name":"艾力",
    "id":"201909090",
   "department":"阿里巴巴",
   "position":"客户端开发",
   "addr":"中国杭州",
    "contact":"15699988877",
    "email":"ali@alibaba.com",
   "time":"2019-09"
}
tpl.render(context)
tpl.save("{}的劳动合同.docx".format(context['name']))
